// Glowing event card wrapper styles
.glow-event-card-wrapper {
  position: relative;
  border-radius: 10px;
  animation: slideInUp 0.6s ease-out forwards, shake 3s ease-in-out infinite;
  animation-delay: 0s, 0.6s;

  ::ng-deep .dashboard-card.p-card {
    border: 3px solid !important;
    border-radius: 10px !important;
    box-shadow: none !important;
  }

  // Override hover effect from dashboard-card
  ::ng-deep .dashboard-card.p-card:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  &.severity-error {
    box-shadow:
      0 0 20px rgba(239, 68, 68, 0.7),
      0 0 40px rgba(239, 68, 68, 0.5),
      0 0 60px rgba(239, 68, 68, 0.3);
    animation: slideInUp 0.6s ease-out forwards, glowBorderError 2s ease-in-out infinite, shake 3s ease-in-out infinite;
    animation-delay: 0s, 0.6s, 0.6s;

    ::ng-deep .dashboard-card.p-card {
      border-color: var(--red-500) !important;
    }
  }

  &.severity-warning {
    box-shadow:
      0 0 20px rgba(234, 179, 8, 0.7),
      0 0 40px rgba(234, 179, 8, 0.5),
      0 0 60px rgba(234, 179, 8, 0.3);
    animation: slideInUp 0.6s ease-out forwards, glowBorderWarning 2s ease-in-out infinite, shake 3s ease-in-out infinite;
    animation-delay: 0s, 0.6s, 0.6s;

    ::ng-deep .dashboard-card.p-card {
      border-color: var(--yellow-500) !important;
    }
  }

  &.severity-important {
    box-shadow:
      0 0 20px rgba(249, 115, 22, 0.7),
      0 0 40px rgba(249, 115, 22, 0.5),
      0 0 60px rgba(249, 115, 22, 0.3);
    animation: slideInUp 0.6s ease-out forwards, glowBorderImportant 2s ease-in-out infinite, shake 3s ease-in-out infinite;
    animation-delay: 0s, 0.6s, 0.6s;

    ::ng-deep .dashboard-card.p-card {
      border-color: var(--orange-500) !important;
    }
  }

  &.severity-info {
    box-shadow:
      0 0 20px rgba(59, 130, 246, 0.7),
      0 0 40px rgba(59, 130, 246, 0.5),
      0 0 60px rgba(59, 130, 246, 0.3);
    animation: slideInUp 0.6s ease-out forwards, glowBorderInfo 2s ease-in-out infinite, shake 3s ease-in-out infinite;
    animation-delay: 0s, 0.6s, 0.6s;

    ::ng-deep .dashboard-card.p-card {
      border-color: var(--blue-500) !important;
    }
  }

  &.severity-default {
    box-shadow:
      0 0 20px rgba(100, 100, 100, 0.5),
      0 0 40px rgba(100, 100, 100, 0.3),
      0 0 60px rgba(100, 100, 100, 0.2);
    animation: slideInUp 0.6s ease-out forwards, glowBorderDefault 2s ease-in-out infinite, shake 3s ease-in-out infinite;
    animation-delay: 0s, 0.6s, 0.6s;

    ::ng-deep .dashboard-card.p-card {
      border-color: var(--surface-border) !important;
    }
  }

  .event-data-content {
    max-height: 300px;
    overflow-y: auto;
    background: var(--surface-50);
    border-radius: 6px;
    padding: 1rem;

    pre {
      margin: 0;
      white-space: pre-wrap;
      word-wrap: break-word;
      font-family: 'Courier New', monospace;
    }
  }

  .glow-card-footer {
    border-top: 1px solid var(--surface-border);
    padding-top: 1rem;
    margin-top: 1rem;

    @media (max-width: 768px) {
      .flex.align-items-center.justify-content-between {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;

        .flex.align-items-center.gap-2 {
          justify-content: center;
        }

        button {
          width: 100%;
        }
      }
    }
  }
}

// Glowing border animations
@keyframes glowBorderError {
  0%, 100% {
    box-shadow:
      0 0 20px rgba(239, 68, 68, 0.7),
      0 0 40px rgba(239, 68, 68, 0.5),
      0 0 60px rgba(239, 68, 68, 0.3);
  }
  50% {
    box-shadow:
      0 0 35px rgba(239, 68, 68, 0.9),
      0 0 60px rgba(239, 68, 68, 0.7),
      0 0 90px rgba(239, 68, 68, 0.5);
  }
}

@keyframes glowBorderImportant {
  0%, 100% {
    box-shadow:
      0 0 20px rgba(249, 115, 22, 0.7),
      0 0 40px rgba(249, 115, 22, 0.5),
      0 0 60px rgba(249, 115, 22, 0.3);
  }
  50% {
    box-shadow:
      0 0 35px rgba(249, 115, 22, 0.9),
      0 0 60px rgba(249, 115, 22, 0.7),
      0 0 90px rgba(249, 115, 22, 0.5);
  }
}

@keyframes glowBorderWarning {
  0%, 100% {
    box-shadow:
      0 0 20px rgba(234, 179, 8, 0.7),
      0 0 40px rgba(234, 179, 8, 0.5),
      0 0 60px rgba(234, 179, 8, 0.3);
  }
  50% {
    box-shadow:
      0 0 35px rgba(234, 179, 8, 0.9),
      0 0 60px rgba(234, 179, 8, 0.7),
      0 0 90px rgba(234, 179, 8, 0.5);
  }
}

@keyframes glowBorderInfo {
  0%, 100% {
    box-shadow:
      0 0 20px rgba(59, 130, 246, 0.7),
      0 0 40px rgba(59, 130, 246, 0.5),
      0 0 60px rgba(59, 130, 246, 0.3);
  }
  50% {
    box-shadow:
      0 0 35px rgba(59, 130, 246, 0.9),
      0 0 60px rgba(59, 130, 246, 0.7),
      0 0 90px rgba(59, 130, 246, 0.5);
  }
}

@keyframes glowBorderDefault {
  0%, 100% {
    box-shadow:
      0 0 20px rgba(100, 100, 100, 0.5),
      0 0 40px rgba(100, 100, 100, 0.3),
      0 0 60px rgba(100, 100, 100, 0.2);
  }
  50% {
    box-shadow:
      0 0 35px rgba(100, 100, 100, 0.7),
      0 0 60px rgba(100, 100, 100, 0.5),
      0 0 90px rgba(100, 100, 100, 0.3);
  }
}

// Shake animation
@keyframes shake {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }
  2% {
    transform: translateX(-3px) rotate(-0.5deg);
  }
  4% {
    transform: translateX(3px) rotate(0.5deg);
  }
  6% {
    transform: translateX(-3px) rotate(-0.5deg);
  }
  8% {
    transform: translateX(3px) rotate(0.5deg);
  }
  10% {
    transform: translateX(0) rotate(0deg);
  }
}

.dashboard-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  
  .card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
  }
  
  .card-subtitle {
    font-size: 0.875rem;
    color: var(--text-color-secondary);
  }

  .grid-container {
    margin-bottom: 2rem;
  }
  
  /* Overview Boxes */
  .overview-box {
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;

    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    
    &:hover {
      transform: translateY(-5px);
      box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    }
    
    .overview-icon {
      width: 3rem;
      height: 3rem;
      border-radius: 50%;
      background-color: rgba(255, 255, 255, 0.2);
      display: flex;
      align-items: center;
      justify-content: center;
      margin-right: 1rem;
      
      i {
        font-size: 1.5rem;
      }
    }
    
    .overview-data {
      flex: 1;
      
      .overview-value {
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 0.25rem;
      }
      
      .overview-label {
        font-size: 0.9rem;
        opacity: 0.9;
      }
    }
  }
  
  /* Card styling */
  ::ng-deep {
    .dashboard-card {
      height: 100%;
      transition: transform 0.3s, box-shadow 0.3s;
      box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
      border: 1px solid var(--surface-border);
      display: flex;
      flex-direction: column;
      
      &:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      }
      
      .p-card-header {
        padding: 0;
      }
      
      .card-title {
        font-size: 1.25rem;
        font-weight: 600;
        margin-bottom: 0.25rem;
      }
      
      .card-subtitle {
        color: var(--text-color-secondary);
        font-size: 0.875rem;
      }
      
      .p-card-body {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 0;
        overflow: hidden;
      }
      
      .p-card-content {
        flex: 1;
        padding: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
      }
    }
    
    /* Progress bar styling */
    .p-progressbar {
      height: 8px;
      background-color: var(--surface-200);
      border-radius: 4px;
      overflow: hidden;
      
      .p-progressbar-value {
        background-color: var(--primary-color);
        transition: width 0.5s ease;
      }
      
      &.warning-progress .p-progressbar-value {
        background-color: var(--yellow-500);
      }
      
      &.danger-progress .p-progressbar-value {
        background-color: var(--red-500);
      }
    }
    
    /* Timeline customizations */
    .activity-timeline {
      .p-timeline-event-opposite {
        flex: 0;
        padding: 0 1rem;
      }
      
      .p-timeline-event-content {
        padding: 0 1rem 1.5rem 1rem;
      }
      
      .activity-icon-container {
        display: flex;
        justify-content: center;
        
        .activity-icon {
          width: 2.5rem;
          height: 2.5rem;
          border-radius: 50%;
          display: flex;
          align-items: center;
          justify-content: center;
          color: white;
          
          i {
            font-size: 1rem;
          }
        }
      }
      
      .activity-item {
        background-color: var(--surface-card);
        border-radius: var(--border-radius);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
        transition: transform 0.2s, box-shadow 0.2s;
        
        &:hover {
          transform: translateX(3px);
          box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        }
      }
    }
  }
  
  /* Status indicators */
  .status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    
    &.active {
      background-color: var(--green-500);
      box-shadow: 0 0 0 3px rgba(80, 200, 120, 0.2);
    }
    
    &.inactive {
      background-color: var(--text-color-secondary);
    }
    
    &.warning {
      background-color: var(--yellow-500);
      box-shadow: 0 0 0 3px rgba(255, 213, 79, 0.2);
    }
    
    &.error {
      background-color: var(--red-500);
      box-shadow: 0 0 0 3px rgba(255, 86, 48, 0.2);
    }
  }
  
  /* Card content styling */
  .card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 1.5rem;
    
    // Console style viewer for dashboard cards
    .viewer-console {
      flex: 1;
      overflow-y: auto;
      position: relative;
      min-height: 400px;
      max-height: 400px;
      display: block;
    }
  }
  
  .card-footer {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
  }
  
  /* Responsive adjustments */
  @media screen and (max-width: 768px) {
    .overview-box {
      margin-bottom: 1rem;
    }
    
    ::ng-deep .activity-timeline {
      .p-timeline-event {
        flex-direction: column !important;
        
        .p-timeline-event-opposite {
          padding: 0;
          margin-bottom: 0.5rem;
        }
        
        .p-timeline-event-content {
          padding: 0 0 1.5rem 2rem;
        }
      }
    }
  }
}

// Header title container and status tag styles
.header-title-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  
  h2 {
    margin: 0;
    line-height: 1.2;
  }
  
  .card-subtitle {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
  }
  
  ::ng-deep .status-tag {
    display: flex;
    align-items: center;
    height: 1.5rem;
    
    .p-tag-value {
      line-height: 1;
      font-size: 0.75rem;
    }
  }
  
  @media (max-width: 768px) {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    
    ::ng-deep .status-tag {
      align-self: flex-start;
    }
  }
}

// Timeline styling
.timeline-container {
  position: relative;
  
  .timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding-bottom: 1rem;
    position: relative;
    
    &:not(:last-child) {
      &::after {
        content: '';
        position: absolute;
        left: 1rem;
        top: 2rem;
        bottom: -0.5rem;
        width: 2px;
        background-color: var(--surface-border);
      }
    }
    
    .timeline-marker {
      position: relative;
      z-index: 1;
      
      .timeline-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 2rem;
        height: 2rem;
        border-radius: 50%;
        font-size: 0.875rem;
        font-weight: 500;
        border: 2px solid var(--surface-ground);
        background-color: var(--surface-ground);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        transition: transform 0.2s;
        
        &:hover {
          transform: scale(1.1);
        }
        
        i {
          font-size: 1rem;
        }
      }
    }
    
    .timeline-content {
      flex: 1;
      min-width: 0;
      
      .timeline-message {
        font-size: 0.875rem;
        line-height: 1.4;
        color: var(--text-color);
        word-break: break-word;
      }
    }
  }
}

.events-card {
  .timeline-item {
    padding-bottom: 2rem;
  }
}

// Log icon styling
.log-icon-error {
  background-color: var(--red-100);
  color: var(--red-600);
  border-color: var(--red-200);
  box-shadow: 0 0 0 2px var(--red-50);
  
  i {
    color: var(--red-600);
    font-size: 1rem;
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
  }
}

.log-icon-warning {
  background-color: var(--orange-100);
  color: var(--orange-600);
  border-color: var(--orange-200);
  box-shadow: 0 0 0 2px var(--orange-50);
  
  i {
    color: var(--orange-600);
    font-size: 1rem;
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
  }
}

.log-icon-info {
  background-color: var(--blue-100);
  color: var(--blue-600);
  border-color: var(--blue-200);
  box-shadow: 0 0 0 2px var(--blue-50);
  
  i {
    color: var(--blue-600);
    font-size: 1rem;
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
  }
}

.log-icon-debug {
  background-color: var(--gray-100);
  color: var(--gray-600);
  border-color: var(--gray-200);
  box-shadow: 0 0 0 2px var(--gray-50);
  
  i {
    color: var(--gray-600);
    font-size: 1rem;
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
  }
}

.log-icon-default {
  background-color: var(--surface-100);
  color: var(--text-color-secondary);
  border-color: var(--surface-200);
  box-shadow: 0 0 0 2px var(--surface-50);
  
  i {
    color: var(--text-color-secondary);
    font-size: 1rem;
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
  }
}

// Event icon styling
.event-icon-strike {
  background-color: var(--yellow-100);
  color: var(--yellow-600);
  border-color: var(--yellow-200);
  box-shadow: 0 0 0 2px var(--yellow-50);
  
  i {
    color: var(--yellow-600);
    font-size: 1rem;
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
  }
}

.event-icon-strike-error {
  background-color: var(--red-100);
  color: var(--red-600);
  border-color: var(--red-200);
  box-shadow: 0 0 0 2px var(--red-50);
  
  i {
    color: var(--red-600);
    font-size: 1rem;
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
  }
}

.event-icon-strike-warning {
  background-color: var(--orange-100);
  color: var(--orange-600);
  border-color: var(--orange-200);
  box-shadow: 0 0 0 2px var(--orange-50);
  
  i {
    color: var(--orange-600);
    font-size: 1rem;
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
  }
}

.event-icon-error {
  background-color: var(--red-100);
  color: var(--red-600);
  border-color: var(--red-200);
  box-shadow: 0 0 0 2px var(--red-50);
  
  i {
    color: var(--red-600);
    font-size: 1rem;
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
  }
}

.event-icon-warning {
  background-color: var(--orange-100);
  color: var(--orange-600);
  border-color: var(--orange-200);
  box-shadow: 0 0 0 2px var(--orange-50);
  
  i {
    color: var(--orange-600);
    font-size: 1rem;
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
  }
}

.event-icon-info {
  background-color: var(--blue-100);
  color: var(--blue-600);
  border-color: var(--blue-200);
  box-shadow: 0 0 0 2px var(--blue-50);
  
  i {
    color: var(--blue-600);
    font-size: 1rem;
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
  }
}

.event-icon-default {
  background-color: var(--surface-100);
  color: var(--text-color-secondary);
  border-color: var(--surface-200);
  box-shadow: 0 0 0 2px var(--surface-50);
  
  i {
    color: var(--text-color-secondary);
    font-size: 1rem;
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
  }
}

// Empty state styling
.empty-state {
  padding: 2rem 1rem;
  
  .pi {
    opacity: 0.5;
  }
  
  p {
    margin: 0;
    font-size: 0.875rem;
  }
}

// Card footer styling
.card-footer {
  border-top: 1px solid var(--surface-border);
  padding-top: 1rem;
  
  .p-button {
    width: 100%;
  }
}

// Responsive adjustments
@media (max-width: 768px) {
  .dashboard-container {
    padding: 1rem;
  }
  
  .timeline-item {
    gap: 0.5rem;
    
    .timeline-marker .timeline-icon {
      width: 1.5rem;
      height: 1.5rem;
      font-size: 0.75rem;
    }
    
    &:not(:last-child)::after {
      left: 0.75rem;
    }
  }
  
  .connection-status {
    span {
      display: none;
    }
  }
}

// Slide in up animation for manual event card
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}